package com.gf.framework.translatordemo.translator;

import com.gf.framework.web.translate.Translatable;
import org.springframework.stereotype.Component;


/**
 * @author gaofei
 * @date 2022/5/26 20:30
 * 手机号码转义
 */
@Component
public class StudentTelePhoneTranslator implements Translatable<String, String> {
    @Override
    public String translate(String original, Class<?> datasource, String param) {
        char[] chars = original.toCharArray();
        for (int i = 3; i < 7; i++) {
            chars[i] = '*';
        }

        return new String(chars);
    }
}
